package com.bd.scm.domain.models.visitor;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.List;

/**访客单
 * Created with IntelliJ IDEA.
 * User: _Cps
 * Date: 2020.09.14 13:29
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName("bd_visit_order")
public class VisitOrder implements Serializable {

    private static final long serialVersionUID = 1L;

    /**order_id*/
    @TableField("order_id")
    private Long orderId;

    /**order_no*/
    @TableField("order_no")
    private String orderNo;

    /**员工ID*/
    @TableField("employee_id")
    private Long employeeId;

    /**访客ID*/
    @TableField("visitor_id")
    private Long visitorId;

    /**访问基地*/
    @TableField("visit_base")
    private int visitBase;

    /**访问区域*/
    @TableField("visit_area")
    private int visitArea;

    /**访客单位名称*/
    @TableField("visit_company")
    private String visitCompany;

    /**访客姓名*/
    @TableField("visit_name")
    private String visitName;

    /**访客手机号*/
    @TableField("visit_tel")
    private String visitTel;

    /**证件类型*/
    @TableField("vistor_cert_type")
    private int vistorCertType;

    /**证件号码*/
    @TableField("vistor_cert_number")
    private String vistorCertNumber;

    /**来访事由*/
    @TableField("visit_reson")
    private int visitReson;

    /**访客类型*/
    @TableField("visitor_type")
    private int visitorType;

    /**来访开始时间*/
    @TableField("visit_date_begin")
    private String visitDateBegin;

//    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    /**来访结束时间*/
    @TableField("visit_date_end")
    private String visitDateEnd;

    /**随行人数量*/
    @TableField("visit_follow_count")
    private int visitFollowCount;

    /**单据类型
     1. 访客申请
     2. 员工邀约*/
    @TableField("order_type")
    private int orderType;

    /**单据状态
     0：待审核
     2：驳回
     3：通过
     4：自动审批*/
    @TableField("approve_status")
    private int approveStatus;

    /**最后审批人*/
    @TableField("last_approve_id")
    private long lastApproveId;

    /**审批驳回原因*/
    @TableField("reject_reson")
    private String rejectReson;

    /**审批时间*/
    @TableField("last_approve_time")
    private String lastApproveTime;

    /**创建时间*/
    @TableField("create_time")
    private String createTime;

    //随行人员
    private List<VisitOrderFollow> followList;

    //车辆信息
    private List<VisitOrderCar> carList;
}
